<#include '/admin/header.html' > <#assign dateformat=
"com.enation.framework.directive.DateformateDirective"?new()>
<script type="text/javascript" src="${ctx}/shop/admin/js/Comments.js"></script>
<div class="main"  style="background-color: white;">
	<div class="easyui-panel" style="border-style: none;">
		<div style="padding: 5px 0 0 10px">
			<table>
				<tr>
					<td>
						<#if memberComment.type == 1>
							<h3>评论人： <#if member??>${member.uname}<#else>游客</#if></h3>
							<h3>评论时间：[<@dateformat time='${memberComment.dateline}' pattern='yyyy-MM-dd'/>]</h3>
						<#else>
							<h3>咨询人： <#if member??>${member.uname}<#else>游客</#if></h3>
							<h3>咨询时间：[<@dateformat time='${memberComment.dateline}' pattern='yyyy-MM-dd'/>]</h3>
						</#if>
						<h3>当前状态：
							<#if memberComment.status == 0>未审核</#if> 
							<#if memberComment.status == 1>审核通过</#if> 
							<#if memberComment.status == 2>审核拒绝</#if>
						</h3>
						
						<br />
						<#if memberComment.type == 1>
							<h3>评论内容:</h3>
						<#else>
							<h3>咨询内容:</h3>
						</#if>
						<div class="division" style="border:1px solid #BEBEBE;min-height: 130px;width: 565px;word-wrap: break-word;">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							${memberComment.content } 
						</div>
						<#if galleryList?size != 0 >
							<h3>评论图片：</h3> 
							<#list galleryList as gallery>
								<a href="${gallery.original!''}" target="_blank">
									<img src="${gallery.original!''}" width="100px;" height="100px;"/> 
								</a> 
							</#list>
						</#if>
						<br />
						<h3 align="center">
							<#if memberComment.status == 0> 
								<a href="javascript:;" id="cshow" comment_id="${memberComment.comment_id }" class="easyui-linkbutton">通过</a>
								<a href="javascript:;" id="chide" comment_id="${memberComment.comment_id }" class="easyui-linkbutton">拒绝</a>
							</#if>
						</h3>
						
						<#if memberComment.replystatus==0 >
							<div style="margin: 20px 0 0 0;">
								<#if memberComment.type == 1>
									<h3>回复用户评论:</h3>
								<#else>
									<h3>回复用户咨询:</h3>
								</#if>
								<form method="post" action="${ctx}/shop/admin/comments/add.do" class="validate" id="addcomment" style="float: left;">
									<table>
										<tr>
											<th>
												<input type="hidden" name="comment_id" value="${memberComment.comment_id }" />
												<textarea rows="7" cols="70" id="recomment" name="reply" style="border: solid #069 1px;"></textarea>
											</th>
										</tr>
									</table>
									<div class="submitlist" align="center">
										<table>
											<tr>
												<td><a href="javascript:;" class="button" comment_id="${memberComment.comment_id }" id="comments_commit">回复</a></td>
											</tr>
										</table>
									</div>
								</form>
							</div>
						</#if> 
						<#if memberComment.replystatus==1 >
							<div class="tableform" style="margin: 20px 0 0 0;">
								<h3>管理员于[<@dateformat time='${memberComment.replytime}' pattern='yyyy-MM-dd'/>]回复：</h3>
								<div class="division" style="border:1px solid #BEBEBE;width: 565px;min-height: 130px;word-wrap: break-word;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									${memberComment.reply!''}
								</div>
							</div> 
						</#if>
					</td>
				</tr>
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">

$(function(){
	
$("#comments_commit").click(function(){
	var comment_id=$(this).attr("comment_id");
	if( $.trim( $("#recomment").val())=='' ){alert("请输入回复内容"); return false;}
	$("#comments_commit").attr("disabled",true); 
	$.Loading.show('正在回复留言，请稍侯...');
	var options = { 
		url : "${ctx}/shop/admin/comments/add.do?commentId="+comment_id,
		type : "POST",
		dataType : 'json',
		success : function(date) {
			$.Loading.hide();				
			if(date.result==1){
				$("#comments_commit").attr("disabled",false); 
				$("#commentscontent").html("");
				location.reload();
	 		}else{
		 		alert(result.message);
		 		$("#comments_commit").attr("disabled",false); 
		 	}
		},
		error : function(e) {
			$.Loading.hide();
			alert("出现错误 ，请重试");
			$("#comments_commit").attr("disabled",false); 
		}
	};
	$('#addcomment').ajaxSubmit(options);	
});


$(".deleteLink").click(function(){
	var comment_id = $(this).attr("comment_id");
	$.ajax({
		url:'${ctx}/shop/admin/comments/deletealone.do?commentId='+comment_id,
		dataType:'html',
		success:function(result){
			parent.ShortMsg.checkNewMsg();
				location.reload();
		}
	});
});
});
</script>
<#include '/admin/footer.html' >